<#
架构健康检查（原生 PowerShell）
用途：检查关键源码目录与架构文档是否存在。
用法：
powershell -ExecutionPolicy Bypass -File scripts\windows\check-architecture.ps1
#>
param()

$ScriptDir = Split-Path -Parent $PSCommandPath
$AIDDir = Split-Path -Parent $ScriptDir

$mustDirs = @(
  Join-Path $AIDDir 'src\main\java',
  Join-Path $AIDDir 'src\main\python',
  Join-Path $AIDDir 'src\main\resources'
)
$mustDocs = @(
  Join-Path $AIDDir 'rules\ddd_design_guide.md',
  Join-Path $AIDDir 'rules\code_design_rules.md'
)

$missing = @()
foreach ($d in $mustDirs) { if (!(Test-Path $d)) { $missing += $d } }
foreach ($f in $mustDocs) { if (!(Test-Path $f)) { $missing += $f } }

if ($missing.Count -gt 0) {
  Write-Warning "架构检查存在缺失：`n - " + ($missing -join "`n - "); exit 2
} else { Write-Host "架构健康检查通过"; exit 0 }
